package Game;

import java.awt.Graphics2D;
import java.util.LinkedList;

public class EffectManager
{
	static LinkedList<Effect> effects;
	
	private EffectManager() {}
	
	public static void Setup()
	{
		effects = new LinkedList<Effect>();
	}
	
	public static void AddEffect(Effect effect)
	{
		System.out.print("Efeito " + effect.type.toString());
		effects.add(effect);
		System.out.println(" adicionado");
	}
	
	public static void Update()
	{
		if(effects != null)
		{
			for(Effect effect : effects)
			{
				effect.Update();
				
				if(!effect.active)
				{
					effects.remove(effect);
					break;
				}
			}
		}
	}
	
	public static void Draw(Graphics2D g2d)
	{
		if(effects != null)
		{
			for(Effect effect : effects)
			{
				effect.Draw(g2d);
			}
		}
	}	
}
